﻿function blank()
{
    //
}
//if(self!=top){top.location=self.location;}
 var isylmf=false;
 var countimg=document.createElement('img'); 

function SetCookie (name, value) { 
       var exp = new Date(); 
       exp.setTime (exp.getTime()+3600000000); 
       document.cookie = name + "=" + value + "; expires=" + exp.toGMTString()+"; path=/"; 
}

function getCookieVal (offset) { 
	var endstr = document.cookie.indexOf (";", offset); 
	if (endstr == -1) endstr = document.cookie.length; 
    return unescape(document.cookie.substring(offset, endstr)); 
 } 
function DelCookie(name)
{
var exp = new Date();
exp.setTime (exp.getTime() - 1);
var cval = GetCookie (name);
document.cookie = name + "=" + cval + "; expires="+ exp.toGMTString();
}

function GetCookie(name) {
         var arg = name + "="; 
         var alen = arg.length; 
         var clen = document.cookie.length; 
         var i = 0; 
         while (i < clen) { 
             var j = i + alen; 
             if (document.cookie.substring(i, j) == arg) return getCookieVal (j); 
             i = document.cookie.indexOf(" ", i) + 1; 
             if (i == 0) break; 
         } 
	     return null; 
 } 
 
function DelHtml(Word) {
  a = Word.indexOf("<");
  b = Word.indexOf(">");
  len = Word.length;
  c = Word.substring(0, a);
  if(b == -1)
  b = a;
  d = Word.substring((b + 1), len);
  Word = c + d;
  tagCheck = Word.indexOf("<");
   if(tagCheck != -1)
   Word = DelHtml(Word);
   return Word;
} 


function glog(evt)
{	
  evt=evt?evt:window.event;var srcElem=(evt.target)?evt.target:evt.srcElement;
try
{
while(srcElem.tagName.toUpperCase()=="A" || srcElem.parentNode.tagName.toUpperCase()=="A") 
{

address=srcElem.href;
urlReg = /^http:\/\/(.*)\/catalog/;
urlReg2 = /^http:\/\/(.*)/; 
if (!urlReg.test(address)){
if(srcElem.parentNode.parentNode.id=="mingzhan"||srcElem.parentNode.parentNode.id=="pagelist"||srcElem.parentNode.parentNode.id=="pagelist2"||srcElem.parentNode.parentNode.id=="indextool" ||srcElem.parentNode.parentNode.parentNode.id=="pagelist"||srcElem.parentNode.parentNode.parentNode.parentNode.id=="pagelist"||srcElem.parentNode.parentNode.parentNode.parentNode.parentNode.id=="pagelist"||srcElem.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id=="pagelist"||srcElem.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id=="pagelist"||srcElem.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id=="pagelist2"||srcElem.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id=="pagelist2"||srcElem.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id=="pagelist2"||srcElem.parentNode.parentNode.parentNode.id=="pagelist2"||srcElem.parentNode.parentNode.parentNode.id=="indextool" )
{
 linkname=DelHtml(srcElem.innerHTML); 
 if(linkname.indexOf('欢迎您') >= 0){ return;}
 if(linkname.indexOf('提交网站') >= 0){ return;}
 if(linkname.indexOf('http:') >= 0){ return;}
 if (linkname!='undefined' && linkname!='更多&gt;&gt;' && linkname!='»详细介绍' && linkname!='»查看指数')
 {
    wlink=linkname+"+"+address+"_0460_"; 
    wlink+=GetCookie("history");
    wlink=escape(wlink);
    SetCookie("history",wlink); 
    history_show();
    }
}
}
if(urlReg2.test(address)){
		var regular = /\b(http:\/\/[-a-z0-9]+\.0460\.com\b(\/[-a-z0-9_:\@&?=+,.!/~%\$]*)?)/;
		if(!regular.test(address) && srcElem.parentNode.parentNode.id=="pagelist" && srcElem.id){
                        var q = 0;
			if(getq()){
			   q = 1;	 
			}
                        var id = srcElem.id;
                        var t = srcElem.innerText ? srcElem.innerText : srcElem.textContent;
                        //countimg.src = "http://www.0460.com/intl/clickout.aspx?sId="+id+"&t="+t+"&i="+Math.random(); //统计点出.
		}
}
srcElem = srcElem.parentNode;
}
}
catch(e){}
return true;
}

function getq()
{
   var qvod;
   var user_agent = navigator.userAgent;
   var is_vista = user_agent.indexOf("Windows NT 6.0") > -1 || user_agent.indexOf("Windows Vista") > -1;
   try{
         

	 if(is_vista){
         qvod=null;
	 }else{
		 qvod = new ActiveXObject("QvodInsert.QvodCtrl.1");
	 }		
	 if(qvod== null){
                
        return false;
      
	 }	
	  
   }
   catch( e ){
  
	  return false;
   
   }
   

   delete qvod;
      
   return true;

}

function strip_tags(source) {
	return source.replace(/<[^>]*>/g, "");
}



function history_show()
{   
try
{
 var history=GetCookie("history");
 history=unescape(history);
 var content='';
 if(history!="null")    //if(history!="null" &&history.indexOf("&")==-1)
 {
 history_arg=history.split("_0460_");
 i=0;
 linknum=0;
 len= history_arg.length;
 var sLinkText;
 for(i=0;i<len;i++)
 { 
 	var wlink=history_arg[i].split("+");
    if(history_arg[i]!="null" && content.indexOf(wlink[0])==-1 && linknum < 12)
    {
        sLinkText = wlink[0].replace("\n","");
        if(sLinkText.length >= 12)
        {
            sLinkText = sLinkText.substring(0, 11) + "..";
        }
       content+="<li><a href=\""+wlink[1]+"\" target=\"_blank\"  title=\""+wlink[0]+"\">"+sLinkText+"</a></li>";
       linknum+=1;
    }
    
}    
 document.getElementById("history").innerHTML=content; 

}else{
 	document.getElementById("history").innerHTML="<br><br><center>没有任何浏览记录</center>";

}
}
catch(e){}
}
function ClearHistory()
{
clean=confirm("确定要清除所有的浏览记录？")	
if(clean)
{
	DelCookie("history");
	document.getElementById("history").innerHTML="<br><br><center>没有任何浏览记录</center>";

	}
}


//Google.cn关键词预读
function val(key){
	for(var i=0; i<s.length; i++)
	{
		var kv = s[i].split("=");
		if(kv.length != 2) continue;

		if(kv[0] == key) return kv[1];
	}
  return "";
}
function $(i) { return document.getElementById(i);}
function getPosition(ele){
	var overflown = [];
	var el = ele, left = 0, top = 0;
	do {
		left += el.offsetLeft || 0;
		top += el.offsetTop || 0;
		el = el.offsetParent;
	} while (el);
	return {'x': left, 'y': top};
}
function setCookie(k, v, opt)
{
	var val = encodeURIComponent(v);
	if(opt)
	{
		if(opt.duration)
		{
			var d = new Date();
			d.setTime(d.getTime() + opt.duration*24*3600*1000);
			val += '; expires=' + d.toGMTString();
		}
		if(opt.path)
			val += '; path=' + opt.path;
	}
	document.cookie = k + '=' + val + ';';
}

function getCookie(k)
{
  var c = document.cookie.split("; ");
  for(var i=0; i<c.length; i++)
  {
    var p = c[i].split("=");
    if(k == p[0])
      return decodeURIComponent(p[1]);
  }
  return null;
}

function googleHint(key)
{
    if($('gsuggest')!=null)$('gsuggest').removeNode(true);
    var sg=document.body.appendChild(document.createElement('script'));
    sg.language='javascript';
    sg.id='gsuggest';
    sg.charset='utf-8';
    sg.src='http://www.google.cn/complete/search?hl=zh-CN&client=suggest&js=true&q=' + encodeURIComponent(key);
}
function hintg()
{
    var keyword=$('q');
    var h=$('kwhg');
    if(!keyword.value || !keyword.value.length || event.keyCode==27 || event.keyCode==13)
    {
        h.style.display='none';return;
    }
    if(event.keyCode==38 || event.keyCode==40)
    {
        if(h.style.display=='none') return;
        if(event.keyCode==38)
        {
            if(h._i==-1)
                h._i=h.firstChild.rows.length-1;
            else
                {h._i--;}
              
        }
        else
        { h._i++; }
        for(var i=0; i<h.firstChild.rows.length; i++)
            h.firstChild.rows[i].style.backgroundColor="#ECF5FF";
        if(h._i >= 0 && h._i < h.firstChild.rows.length)
            with(h.firstChild.rows[h._i])
            {
                style.backgroundColor="#00c";keyword.value=cells[0].innerText;
            }
        else
        {
            keyword.value=h._kw;h._i=-1;
        }
    }
    else
    {
        h._i=-1;
        h._kw=keyword.value;
        googleHint(keyword.value);
        var pos=getPosition(keyword);
        with(h.style)
        {left=pos.x;top=pos.y+keyword.offsetHeight;width=keyword.offsetWidth;}
   
    }
}

function hintsogou()
{
    var keyword=$('query');
    var h=$('kwhsogou');
    if(!keyword.value || !keyword.value.length || event.keyCode==27 || event.keyCode==13)
    {
        h.style.display='none';return;
    }
    if(event.keyCode==38 || event.keyCode==40)
    {
        if(h.style.display=='none') return;
        if(event.keyCode==38)
        {
            if(h._i==-1)
                h._i=h.firstChild.rows.length-1;
            else
                {h._i--;}
              
        }
        else
        { h._i++; }
        for(var i=0; i<h.firstChild.rows.length; i++)
            h.firstChild.rows[i].style.backgroundColor="#ECF5FF";
        if(h._i >= 0 && h._i < h.firstChild.rows.length)
            with(h.firstChild.rows[h._i])
            {
                style.backgroundColor="#00c";keyword.value=cells[0].innerText;
            }
        else
        {
            keyword.value=h._kw;h._i=-1;
        }
    }
    else
    {
        h._i=-1;
        h._kw=keyword.value;
        googleHint(keyword.value);
        var pos=getPosition(keyword);
        with(h.style)
        {left=pos.x;top=pos.y+keyword.offsetHeight;width=keyword.offsetWidth;}
   
    }
}

function hintgougou()
{
    var keyword=$('search1');
    var h=$('kwhgougou');
    if(!keyword.value || !keyword.value.length || event.keyCode==27 || event.keyCode==13)
    {
        h.style.display='none';return;
    }
    if(event.keyCode==38 || event.keyCode==40)
    {
        if(h.style.display=='none') return;
        if(event.keyCode==38)
        {
            if(h._i==-1)
                h._i=h.firstChild.rows.length-1;
            else
                {h._i--;}
              
        }
        else
        { h._i++; }
        for(var i=0; i<h.firstChild.rows.length; i++)
            h.firstChild.rows[i].style.backgroundColor="#ECF5FF";
        if(h._i >= 0 && h._i < h.firstChild.rows.length)
            with(h.firstChild.rows[h._i])
            {
                style.backgroundColor="#00c";keyword.value=cells[0].innerText;
            }
        else
        {
            keyword.value=h._kw;h._i=-1;
        }
    }
    else
    {
        h._i=-1;
        h._kw=keyword.value;
        googleHint(keyword.value);
        var pos=getPosition(keyword);
        with(h.style)
        {left=pos.x;top=pos.y+keyword.offsetHeight;width=keyword.offsetWidth;}
   
    }
}

function hint()
{
    var keyword=$('wd');
    var h=$('kwh');
    if(!keyword.value || !keyword.value.length || event.keyCode==27 || event.keyCode==13)
    {
        h.style.display='none';return;
    }
    if(event.keyCode==38 || event.keyCode==40)
    {
        if(h.style.display=='none') return;
        if(event.keyCode==38)
        {
            if(h._i==-1)
                h._i=h.firstChild.rows.length-1;
            else
                {h._i--;}
              
        }
        else
        { h._i++; }
        for(var i=0; i<h.firstChild.rows.length; i++)
            h.firstChild.rows[i].style.backgroundColor="#fff";
        if(h._i >= 0 && h._i < h.firstChild.rows.length)
            with(h.firstChild.rows[h._i])
            {
                style.backgroundColor="#00c";keyword.value=cells[0].innerText;
            }
        else
        {
            keyword.value=h._kw;h._i=-1;
        }
    }
    else
    {
        h._i=-1;
        h._kw=keyword.value;
        googleHint(keyword.value);
        var pos=getPosition(keyword);
        with(h.style)
        {left=pos.x;top=pos.y+keyword.offsetHeight;width=keyword.offsetWidth;}
   
    }
}
window.google={};
window.google.ac={};
window.google.ac.Suggest_apply=function(a,b,c,d)
{
    if(!c || c.length<3)
        return;
    var ihtml='';
    var bhtml='';
    var sghtml='';
    var gougouhtml='';
    for(var j=1;j<c.length;j+=2)
    {
        ihtml+='<tr style="cursor:hand" onmouseover="this.bgColor=\'#ebebeb\';$(\'wd\').value=\'' +c[j] +'\';" onmouseout="this.bgColor=\'#ffffff\';"><td align="left">' +c[j] +'</td><td style="color:#008000"  align="right">' +c[j+1] +'</td></tr>';
   		bhtml+='<tr style="cursor:hand" onmouseover="this.bgColor=\'#ebebeb\';$(\'q\').value=\'' +c[j] +'\';" onmouseout="this.bgColor=\'#ffffff\';"><td align="left">' +c[j] +'</td><td style="color:#008000"  align="right">' +c[j+1] +'</td></tr>';
		sghtml+='<tr style="cursor:hand" onmouseover="this.bgColor=\'#ebebeb\';$(\'query\').value=\'' +c[j] +'\';" onmouseout="this.bgColor=\'#ffffff\';"><td align="left">' +c[j] +'</td><td style="color:#008000"  align="right">' +c[j+1] +'</td></tr>';
		gougouhtml+='<tr style="cursor:hand" onmouseover="this.bgColor=\'#ebebeb\';$(\'search1\').value=\'' +c[j] +'\';" onmouseout="this.bgColor=\'#ffffff\';"><td align="left">' +c[j] +'</td><td style="color:#008000"  align="right">' +c[j+1] +'</td></tr>';
    
    }
   if(sx==5)
   {
   	 $('kwhg').innerHTML='<table id="search_related" width="373px" border="0" cellpadding="0" cellspacing="0">'+bhtml+'</table>';
     $('kwhg').style.display="block";
     $('kwh').style.display="none";
	 $('kwhsogou').style.display="none";
          $('kwhgougou').style.display="none";
     }
	 else if(sx==6)
	 {
		  $('kwhsogou').innerHTML='<table id="search_related" width="373px" border="0" cellpadding="0" cellspacing="0">'+sghtml+'</table>';
		  $('kwhsogou').style.display="block";
          $('kwhgougou').style.display="none";
    	  $('kwhg').style.display="none";
          $('kwh').style.display="none"; 
	 }
	 else if(sx==7)
	 {
		  $('kwhgougou').innerHTML='<table id="search_related" width="373px" border="0" cellpadding="0" cellspacing="0">'+gougouhtml+'</table>';
		  $('kwhgougou').style.display="block";
          $('kwhsogou').style.display="none";
    	  $('kwhg').style.display="none";
          $('kwh').style.display="none"; 
	 }
     else
     	{
      $('kwh').innerHTML='<table id="search_related" width="373px" border="0" cellpadding="0" cellspacing="0">'+ihtml+'</table>';
     $('kwh').style.display="block";
       $('kwhg').style.display="none";
	   $('kwhsogou').style.display="none";
          $('kwhgougou').style.display="none";
   }   
};


//邮箱登陆

function clickMail()
{
var gm=document.gomail
var vDomain=gm.domains
var vName=gm.uName
var vPw=gm.uPw
if(vDomain.value==""){alert("您没有选择邮箱！")
	vDomain.focus()
	return false}
if(vName.value==""){alert("用户名不能为空！")
	vName.focus()
	return false
}
if(vPw.value==""){alert("密码不能为空！")
	vPw.focus()
	return false}
switch(vDomain.value){
case "yahoocn":
gm.action="https://edit.bjs.yahoo.com/config/login"
gm.login.value=vName.value+"@yahoo.cn"
gm.passwd.value=vPw.value
break
case "yahoo":   //yahoo.com.cn
gm.action="https://edit.bjs.yahoo.com/config/login"
gm.login.value=vName.value
gm.passwd.value=vPw.value
break
case "sina":
gm.action="http://mail.sina.com.cn/cgi-bin/login.cgi"
gm.u.value=vName.value
gm.psw.value=vPw.value
break
case "sinavip":
gm.action="http://vip.sina.com.cn/cgi-bin/login.cgi"
gm.user.value=vName.value
gm.pass.value=vPw.value
break
case "gmail":
gm.action="https://www.google.com/accounts/ServiceLoginAuth"
gm.Email.value=vName.value
gm.Passwd.value=vPw.value
break
case "sohu":
gm.action="http://passport.sohu.com/login.jsp"
gm.url.value=""
gm.UserName.value=vName.value
gm.Password.value=vPw.value
gm.id.value=vName.value
gm.username.value=vName.value
gm.password.value=vPw.value
gm.m.value=vName.value
gm.passwd.value=vPw.value
gm.mpass.value=vPw.value
gm.loginid.value=vName.value+"@sohu.com"
gm.fl.value="1"
gm.vr.value="1|1"
gm.appid.value="1000"
gm.ru.value="http://login.mail.sohu.com/servlet/LoginServlet"
gm.eru.value="http://login.mail.sohu.com/login.jsp"
gm.ct.value="1173080990"
gm.sg.value="5082635c77272088ae7241ccdf7cf062"
break
case "sohuvip":
gm.action="http://passport.sohu.com/login.jsp"
gm.url.value=""
gm.passwd.value=vPw.value
gm.mpass.value=vPw.value
gm.loginid.value=vName.value+"@vip.sohu.com"
gm.fl.value="1"
gm.vr.value="1|1"
gm.appid.value="1013"
gm.ru.value="http://vip.sohu.com/login/viplogin11.jsp"
gm.eru.value=""
gm.ct.value="1173857434"
gm.sg.value="885ebb7884194ee547f224fc8a6a5877"
break
case "china":
gm.action="http://mail.china.com//coremail/fcg/login"
gm.user.value=vName.value
gm.pass.value=vPw.value
break
case "263":
gm.action="http://g2wm.263.net/xmweb"
gm.usr.value=vName.value
gm.pass.value=vPw.value;
gm.domain.value="263.net";
gm.func.value="login";
break
case "163":
gm.action="http://reg.163.com/CheckUser.jsp"
gm.login.value=vName.value;
gm.passwd.value=vPw.value;
gm.url.value="http://fm163.163.com/coremail/fcg/ntesdoor2?lightweight=1&verifycookie=1&language=-1&style=15";
gm.enterVip.value='';
break
case "188":
gm.action="http://reg.mail.188.com/servlet/coremail/login"
gm.user.value=vName.value;
gm.pass.value=vPw.value;
gm.domain.value="188.com";
gm.language.value=0;
gm.style.value=-1;
break
case "126":
gm.action="https://reg.163.com/logins.jsp"
gm.domain.value="126.com"
gm.username.value=vName.value +"@126.com"
gm.password.value=vPw.value
gm.url.value="http://entry.mail.126.com/cgi/ntesdoor?lightweight%3D1%26verifycookie%3D1%26language%3D0%26style%3D-1";
break
case "tom":
gm.action="http://bjweb.163.net/cgi/163/login_pro.cgi"
gm.user.value=vName.value
gm.pass.value=vPw.value
break
case "21cn":
gm.action="http://passport.21cn.com/maillogin.jsp"
gm.LoginName.value=vName.value
gm.passwd.value=vPw.value
gm.domainname.value="21cn.com"
gm.UserName.value=vName.value+'@21cn.com'
break
case "chinaren":
gm.action="http://passport.sohu.com/login.jsp"
gm.loginid.value=vName.value+"@chinaren.com"
gm.passwd.value=vPw.value
gm.fl.value="1"
gm.vr.value="1|1"
gm.appid.value="1005"
gm.ru.value="http://profile.chinaren.com/urs/setcookie.jsp?burl=http://alumni.chinaren.com/"
gm.ct.value="1174378209"
gm.sg.value="84ff7b2e1d8f3dc46c6d17bb83fe72bd"
break
case "tianya":
gm.action="http://www.tianya.cn/user/loginsubmit.asp"
gm.vwriter.value=vName.value
gm.vpassword.value=vPw.value
break
case "hotmail":
gm.action="https://login.passport.com/ppsecure/post.srf?lc=2052&id=2&tw=20&fs=1&cbid=24325&da=passport.com&kpp=2&svc=mail&msppjph=1"
gm.login.value=vName.value;
gm.passwd.value=vPw.value
gm.domain.value="msn.com";
break
case "msn":
gm.action="https://login.passport.com/ppsecure/post.srf?lc=2052&id=2&tw=20&fs=1&cbid=24325&da=passport.com&kpp=2&svc=mail&msppjph=1"
gm.login.value=vName.value;
gm.passwd.value=vPw.value
gm.domain.value="hotmail.com";
break
case "baidu":
gm.action="http://passport.baidu.com/?login"
gm.username.value=vName.value
gm.password.value=vPw.value
break
case "xiaonei":
gm.action="http://login.xiaonei.com/Login.do"
gm.email.value=vName.value
gm.password.value=vPw.value
break
case "51com":
gm.action="http://passport.51.com/login.5p"
gm.passport_51_user.value=vName.value
gm.passport_51_password.value=vPw.value
gm.gourl.value="http%3A%2F%2Fmy.51.com%2Fwebim%2Findex.php"
break
}
return true} 
